﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace VsSourceCpoy.Entity
{
    public class ParseResult
    {
        public HashSet<string> AllFileList { get; private set; }
        public HashSet<string> SlnFileList { get; set; }
        public HashSet<string> CsprojFileList { get; set; }
        public List<string> ErrorMsg { get; set; }
        public ParseResult(HashSet<string> r)
            : this()
        {
            AllFileList = r;
        }

        public DirectoryInfo CopyFromRoot { get; set; }

        public ParseResult()
        {
            AllFileList = new HashSet<string>();
            SlnFileList = new HashSet<string>();
            CsprojFileList = new HashSet<string>();
            ErrorMsg = new List<string>();
        }

        public void AddReslut(ParseResult res)
        {
            AllFileList.UnionWith(res.AllFileList);
            SlnFileList.UnionWith(res.SlnFileList);
            CsprojFileList.UnionWith(res.CsprojFileList);
            ErrorMsg.AddRange(res.ErrorMsg);
        }

        public void AddPath(string fromPath)
        {
            AllFileList.Add(fromPath);
        }
    }
}
